// 权限模块API
import request from '@/utils/request'

// 当前获取账号菜单
export function getMenuNav(data) {
  return request({
    //url: '/api/manager/menu/nav',
    url: '/apiManage/UserNavList',
    
    method: 'post',
    data
  })
}

// 获取菜单列表
export function selectMenuList(data=[]) {
  return request({
    url: '/api/manager/menu/tree',
    url: '/apiManage/MenuTree',
    method: 'post',
    data
  })
}

// 获取菜单列表
export function getMenuList(data) {
  return request({
    url: '/api/manager/menu/list',
    url: '/apiManage/MenuList',
    method: 'post',
    data
  })
}

// 根据菜单ID获取菜单信息
export function getMenuInfo(params) {
  return request({
 //   url: '/api/manager/menu/info',
    method: 'get',
    params: params
  })
}
// 根据菜单ID获取菜单信息
export function saveMenuInfo(data) {
  return request({
    url: '/api/manager/menu/save',
    url: '/apiManage/MenuUpdate',
    method: 'post',
    data
  })
}
// 根据菜单ID更新菜单信息
export function updateMenuInfo(data) {
  return request({
    url: '/apiManage/MenuUpdate',
    method: 'post',
    data
  })
}

// 根据菜单ID删除菜单信息
export function deletMenuInfo(data) {
  return request({
    url: '/apiManage/MenuDelete',
    method: 'post',
    data
  })
}

// 角色
export function getRoleList(data) {
  return request({
    url: '/apiManage/RoleList',
    method: 'post',
    data
  })
}

export function selectRoleList(data) {
  return request({
   // url: '/api/manager/role/select',
    url: '/apiManage/RoleSelect',
    method: 'post',
    data
  })
}

export function getRoleInfo(params) {
  return request({
   // url: '/api/manager/role/info',
   // method: 'get',
    params: params
  })
}

export function saveRoleInfo(data) {
  return request({
    url: '/api/manager/role/save',
    url:'/apiManage/RoleUpdate',
    method: 'post',
    data
  })
}

export function updateRoleInfo(data) {
  return request({
    url: '/api/manager/role/update',
    url:'/apiManage/RoleUpdate',
    method: 'post',
    data
  })
}

export function deletRoleInfo(data) {
  return request({
    url: '/apiManage/RoleDelete',
    method: 'post',
    data
  })
}

// 用户
export function getUserList(data) {
  return request({
  //  url: '/api/manager/user/list',
    url:'/apiManage/UserList',
    method: 'post',
    data
  })
}

export function getUserInfo(params) {
  return request({
 //   url: '/api/manager/user/info',
  //  method: 'get',
    params: params
  })
}

export function saveUserInfo(data) {
  return request({
    url: '/apiManage/UserUpdate',
    method: 'post',
    data
  })
}

export function updateUserInfo(data) {
  return request({
    url: '/api/manager/user/update',
    url: '/apiManage/UserUpdate',
    method: 'post',
    data
  })
}

export function deletUserInfo(data) {
  return request({
    url: '/api/manager/user/delete',
    url: '/apiManage/UserDel',
    method: 'post',
    data
  })
}
